home *** CD-ROM | disk | FTP | other *** search
- #include <intuition/intuition.h>
- #include <clib/intuition_protos.h>
- #include <clib/graphics_protos.h>
-
- #include "defs.h"
- #include "pointer.h"
- #include "gadgets.h"
-
- extern struct Screen *Scr; /* screen we open up on */
-
- /*=============================================================================
- * Implement a custom window pointer, this may involve changing the colors
- * for Sprite 0.
- *===========================================================================*/
-
- void SetOurPointer(SHORT pointer_num, BOOL GetResetColors)
- {
- int i;
-
- /*
- * GetResetColors should only be TRUE the first time you call
- * SetOurPointer(), This gets and stores the current value of the
- * pointer registers so we can reset them when we're done.
- */
-
- if(GetResetColors)
- for(i=0; i< 4; i++)
- {
- PointerColor[i].reset = GetRGB4(Scr->ViewPort.ColorMap,
- POINTER_REGISTER+i);
- }
-
- for(i=0; i< 4; i++)
- {
- SetRGB4(&Scr->ViewPort,POINTER_REGISTER+i,
- PointerColor[i].red,
- PointerColor[i].green,
- PointerColor[i].blue );
- }
-
- if(pointer_num == MAIN_POINTER)
- SetPointer( ColorSaverWnd, CSPointer, CS_PTR_HEIGHT, CS_PTR_WIDTH,
- CS_PTR_XOFF , CS_PTR_YOFF);
-
- if(pointer_num == TO_POINTER)
- SetPointer( ColorSaverWnd, CSToPointer, CSTO_PTR_HEIGHT, CSTO_PTR_WIDTH,
- CSTO_PTR_XOFF , CSTO_PTR_YOFF);
-
- }
-
- /*=============================================================================
- * Reset the Sprite 0 (pointer) colors to the values they had before we
- * messed with them in SetOurPointer();
- *===========================================================================*/
-
- void ResetPointerColors( void )
- {
- int i;
-
- for(i=0; i< 4; i++)
- {
- SetRGB4(&Scr->ViewPort,POINTER_REGISTER+i,
- (PointerColor[i].reset >> 8) & 0x0F,
- (PointerColor[i].reset >> 4) & 0x0F,
- (PointerColor[i].reset ) & 0x0F);
- }
- }
-